import HomePage from "@/pages/HomePage";
import { lazy } from "react";
const Register = lazy(() => import("@/pages/User/Register"));
const Login = lazy(() => import("@/pages/User/Login"));
const Tip = lazy(() => import("@/components/Commons/Tip"));

const ErrorPage = lazy(() => import("@/components/ErrorPage"));
const PictureDisplay = lazy(() => import("@/pages/PictureDisplay"));
const Transverse = lazy(() =>
  import("@/components/Commons/Picture/Transverse")
);
const Vertical = lazy(() => import("@/components/Commons/Picture/Vertical"));

const ResetPassword = lazy(() => import("@/pages/User/ResetPassword"));
const EmailInput = lazy(() => import("@/pages/User/ResetPassword/EmailInput"));
const Confirm = lazy(() => import("@/pages/User/ResetPassword/Confirm"));
const CodeInput = lazy(() => import("@/pages/User/ResetPassword/CodeInput"));

// 路由映射表
export const routerMap = [
  {
    path: "/",
    element: <HomePage />,
    ErrorPage: <ErrorPage />,
  },
  {
    path: "home",
    element: <HomePage />,
  },
  {
    path: "login",
    element: <Login />,
  },
  {
    path: "register",
    element: <Register />,
  },
  {
    path: "resetPassword",
    element: <ResetPassword />,
    children: [
      {
        index: true,
        // path: "/",
        element: <EmailInput />,
      },
      {
        path: "step2",
        element: <CodeInput />,
      },
      {
        path: "step3",
        element: <Confirm />,
      },
    ],
  },
  { path: "tip", element: <Tip content="注册成功" /> },
  {
    path: "display",
    element: <PictureDisplay />,
  },
  {
    path: "transverse",
    element: <Transverse />,
  },
  {
    path: "Vertical",
    element: <Vertical />,
  },
];
